<style>
    table, th, tr, td {
        border: 1px solid #ccc;
        font-size: 14px;
    }

    .ordertable {
        width: 95%;
        margin: 0 auto;
        border-radius: 10px;
    }

    .tablebox1 {
        padding-top: 10px;
    }

    .payorder {
        display: flex;
        justify-content: center;
        height: 50px;
        line-height: 40px;
        font-size: 18px;
    }

    .paygoods {
        display: flex;
        justify-content: center;
        height: 50px;
        line-height: 40px;
        font-size: 18px;
    }

    .ordertable tr td {
        line-height: 30px;
        text-align: center;
    }
</style>
<div class="layuimini-container">
    <div class="tablebox">
        <div class="payorder">基本信息</div>
        <table class="ordertable">
            <tr>
                <td style="width: 15%;">订单编号：</td>
                <td style="width: 15%;">{$row.order_sn}</td>
                <td style="width: 20%">下单时间：</td>
                <td style="width: 20%">{$row.create_time|date='Y-m-d H:i:s'}</td>
                <td style="width: 15%;">下单用户：</td>
                <td style="width: 15%;">{$row.wechat.nickName}</td>
            </tr>
            <tr>
                <td style="width: 15%;">微信标识：</td>
                <td style="width: 15%;">{$row.openid}</td>
            </tr>

            <tr>
                <td style="width: 15%;">支付状态：</td>
                <td style="width: 15%;">{$row.status_name}</td>
                <td style="width: 20%;">支付时间：</td>
                <td style="width: 20%;">{if condition="$row['pay_time'] neq ''"}{$row.pay_time|date='Y-m-d
                    H:i:s'}{else/}--{/if}
                </td>
                <td style="width: 15%;">发货时间：</td>
                <td style="width: 15%;">{if condition="$row['shipping_time'] neq ''"}{$row.shipping_time|date='Y-m-d
                    H:i:s'}{else/}--{/if}
                </td>
            </tr>
        </table>
    </div>
    <div class="tablebox1">
        <div class="paygoods">购买商品</div>
        <table class="ordertable" style="padding-top: 10px;">
            <tr>
                <td style="width: 20%;">规格</td>
                <td style="width: 20%">规格值</td>
                <td style="width: 20%">购买数量</td>
            </tr>
            {foreach name="goodslist" item="val"}
            <tr>
                <td style="width: 20%;">{$val.specs_title}</td>
                <td style="width: 20%">{$val.specs_name}</td>
                <td style="width: 20%">X 1</td>
            </tr>
            {/foreach}
            <tr>
                <td style="width: 20%;">商品合计：</td>
                <td colspan="5">￥{$row.order_price}</td>
            </tr>
            <tr>
                <td style="width: 20%;">运费金额：</td>
                <td colspan="5">￥{$row.shipping_fee}</td>
            </tr>
            <tr>
                <td style="width: 20%;">折扣金额：</td>
                <td colspan="5">￥{$row.discount_price}</td>
            </tr>
            <tr>
                <td style="width: 20%;">应付金额：</td>
                <td colspan="5">￥{$row.pay_price}</td>
            </tr>

        </table>


</div>
<div class="hr-line"></div>
<form id="app-form" class="layui-form layuimini-form">
    <div class="hr-line"></div>
    <div id="shippingbox" style="display: none;">
        <div class="layui-form-item">
            <label class="layui-form-label">快递名称</label>
            <div class="layui-input-block">
                <input type="text" name="express" class="layui-input" placeholder="请输入快递名称" value="">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">快递公司</label>
            <div class="layui-input-block">
                <input type="text" name="expresscom" class="layui-input" placeholder="请输入快递公司" value="">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">快递单号</label>
            <div class="layui-input-block">
                <input type="text" name="expresssn" class="layui-input" placeholder="请输入快递单号" value="">
            </div>
        </div>
    </div>
    <div class="layui-form-item text-center">
        {if condition="$row['status'] == 0"}
        <input type="hidden" name="orderToStatus" value="1">
        <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认付款</button>
        {/if}
        {if condition="$row['status'] == 1"}
        <input type="hidden" name="orderToStatus" value="2">
        <button type="button" onclick="doshipping(this)" id="shippingdothis"
                class="layui-btn layui-btn-normal layui-btn-sm">确认发货
        </button>
        <button type="submit" id="realsumit" style="display: none" class="layui-btn layui-btn-normal layui-btn-sm"
                lay-submit>确认发货
        </button>
        {/if}
        {if condition="$row['status'] == 2"}
        <input type="hidden" name="orderToStatus" value="3">
        <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认收货</button>
        {/if}
    </div>
</form>
</div>
<script>
    function doshipping() {
        $("#shippingbox").show();
        $("#shippingdothis").hide();
        $('#realsumit').show();
    }
</script>